package com.ny;
import com.ny.entity.Device;
import org.springframework.data.mongodb.repository.MongoRepository;
import java.util.Optional;

// 继承MongoRepository，泛型为<实体类, 主键类型>
public interface DeviceRepository extends MongoRepository<Device, Integer> {
    // 方法名解析：根据deviceName查询
    Optional<Device> findByDeviceName(String deviceName);
}